<? if(isset($errors)) { ?>
	<ul class="error">
		<? foreach($errors as $key => $error){ ?>
			<li><?=$key?>: <?=$error?></li>
		<? } ?>
	</ul>
<? } ?>
       
<form method="post" action="Controller.php">
<table>
	<tr>
		<td>
			<? if(isset($rs['ID'])){ ?>
				<input type="hidden" name="id" value="<?=$rs['ID']?>" />
			<? } ?>
			<input type="hidden" name="action" value="save" />
			<input type="submit" value="Submit" />
			<a href="./" class="cancel_link">Cancel</a>
		</td>
		<td></td>
		<td>
			<select name="person_id" id="person_id"
				class="<? if(isset($errors['Person_ID'])){ ?>error<? } ?>"
				data-value="<?=$rs['Person_ID']?>" >
				<?
					$result = GetUsers();
					while($userRS = $result->fetch_assoc()){
				?>
					<option value='<?=$userRS['ID']?>' >
						<?=$userRS['First_Name']?>
						<?=$userRS['Last_Name']?>
					</option>
				<? } ?>
			</select>
                                                
                                               
			<? if(isset($errors['Person_ID'])){ ?>
				<span class="error"><?=$errors['Person_ID']?></span>
			<? } ?>
		</td>
		
		<td>
			<select type="text" name="category_id" id="category_id"
 				class="<? if(isset($errors['Category_ID'])){ ?>error<? } ?>"
				data-value="<?=$rs['Category_ID']?>" >
				<?
					$result = GetCategories();
					while($userRS = $result->fetch_assoc()){
				?>

					<option value='<?=$userRS['ID']?>'><?=$userRS['Name']?></option>
				<? } ?>
			</select>
                                                                                  
                                                
				<? if(isset($errors['Category_ID'])){ ?>
					<span class="error"><?=$errors['Category_ID']?></span>
				<? } ?>
		</td>
		<td>
			<input  type="text" name="Value" id="Value"
				class="<? if(isset($errors['Value'])){ ?>error<? } ?>"
				value="<?=$rs['Value']?>" />
			<? if(isset($errors['Value'])){ ?>
			<span class="error"><?=$errors['Value']?></span>
			<? } ?>
		</td>
</tr>
</table>
</form>
        